package com.lg.erp.util;

import com.lg.erp.entity.JsonResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(value =Exception.class)
    public JsonResult exceptionHandler(Exception e){
        System.out.println("未知异常！原因是:"+e);
        return new JsonResult(0,e.getMessage(),null);
    }
}
